package com.wanmait.recruitment.service.test;

import com.wanmait.recruitment.service.ConfigService;
import com.wanmait.recruitment.util.RelativeDateFormat;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

import javax.annotation.Resource;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

@SpringBootTest
public class Config {


    @Test
    public void test()
    {
    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    Date date = null;
        try {
        date = format.parse("2020-09-05 18:35:35");
        System.out.println(RelativeDateFormat.format(date));
    } catch (ParseException e) {
        e.printStackTrace();
    }
    }





















    @Resource
    private ConfigService configService;
    @Test
    public void count()
    {
        int count = Integer.parseInt(configService.getValueByKey("job_list_count"));
        System.out.println(count);
    }
}
